@using WebApp.Extensions
@model Dto.ApiResponses.ContactResponses.ContactDetailResponse
@{
    ViewBag.CurrentPage = WebApp.Common.PageSetting.ContactNewPageSetting;
    var sectionId = (Request.IsAjaxRequest() ? "Ajax" : "View") + "_Contact_Add";
}

@section Scripts{
    <script type="text/javascript">

        require(['Contact/add', 'Util'], function (api, util) {
            var model = util.toJS(@(Html.ToJson(Model)));
            $(function () { api.exec('@sectionId', model); });
        });
    </script>
}

<div class="container" data-bind="stopbinding: true">
    <section id="@sectionId">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-6">
                <legend class="h3">Personal Detail</legend>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="photo">Photo</label>
                            <div class="fileDragHolder">
                                <canvas id="imgCanvas" width="150" height="187"></canvas>
                                <div>
                                    <a id="photo" href="#" data-bind="click: selectPhoto">Select File</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="name">Name</label>
                            <input id="name" class="form-control " data-bind="value: name" placeholder="Name" required />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="tname">Title Name</label>
                            <select id="tname" class="form-control" data-bind="options: titleNames, optionsText: 'name', value: titleName, optionsValue: 'name', optionsCaption: '-- Select Type --'" required></select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="fname">First Name</label>
                            <input id="fname" class="form-control " data-bind="value: firstName" placeholder="First Name" required />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="lname">Last Name</label>
                            <input id="lname" class="form-control " data-bind="value: lastName" placeholder="Last Name" required />
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-6">
                <legend class="h3">Contact Detail</legend>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="email">Email</label>
                            <input id="email" class="form-control" data-bind="value: email" placeholder="Email" required />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="phone">Phone</label>
                            <input id="phone" class="form-control" data-bind="value: phone" placeholder="Phone" />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="mobile">Mobile</label>
                            <input id="mobile" class="form-control" data-bind="value: mobile" placeholder="Mobile" />
                        </div>
                    </div>
                </div>

            </div>
            <div class="col-xs-12 col-sm-12 col-md-6">
                <legend class="h3">Other Detail</legend>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="cname">Company Name</label>
                            <input id="cname" class="form-control " data-bind="value: companyName" placeholder="Company Name" />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label>Designation</label>
                            <select class="form-control" data-bind="options: designations, optionsText: 'name', value: designation, optionsValue: 'name', optionsCaption: '-- Select Type --'" required></select>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="description">Description</label>
                            <textarea id="description" class="form-control" rows="3" data-bind="value: description" placeholder="Description"> </textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12">
                <div class="form-group">
                    <div class="col-xs-12 col-sm-12 col-md-12  center">
                        <button class="btn btn-primary btn-lg" data-bind="click: save">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;
                        <button class="btn btn-primary btn-lg" data-bind="click: cancel">Cancel</button>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
